function HandleParcels(gui, item, options) {
  this._gui = gui;
  this._item = item;
  this._options = options;
  this._query = (options && options.query) ? options.query : null;
  this._operator = (options && options.operator) ? options.operator : null;
  this._now = (options && options.now) ? options.now : null;
  this._menu = (options && options.menu) ? options.menu : null;
  this._smryGui = (options && options.smryGui) ? options.smryGui : null;
  this._smryArgs = (options && options.smryArgs) ? options.smryArgs : null;
  
  this._createElements();
};

HandleParcels.prototype._createElements = function() {
  this._loadData();
};

HandleParcels.prototype._verifyData = function() {
  if (this._produces) {
    this._updateElements();
  }
};

HandleParcels.prototype._loadData = function() {
  this._produces = null;
  
  this._retrieveProduces();
};

HandleParcels.prototype._retrieveProduces = function(page, condition) {
  var _self = this;
  condition = (condition) ? condition.replace('(' + this._query + ')' + ' AND ', '') : '';
  
  var joins = '&selects=1' + '&purchaseitems=0' + '&preconusers=0' + '&events=0' + '&tracks=0' + '&produces=0' + '&notes=1';
  var args = '&c=(' + this._query + ')' + ((condition) ? (' AND (' + condition + ')') : '') + '&p=' + ((page) ? page : 1) + '&s=20' + '&o=d.createdDate' + '&q=DESC' + joins;
  new RequestUtils()._mysql('parcels', args, function(result, params) { _self._produces = result.data;
                                                                         _self._parameters = result;
                                                                         _self._verifyData.call(_self);
                                                                        }, { php: 'customphp/produceread.php'});
  
};

HandleParcels.prototype._updateElements = function() {
  var _self = this;
  DOMUtils.removeChildElements(this._gui.pages);
  DOMUtils.removeChildElements(this._gui.tasks);

  if (this._smryGui && this._smryArgs) {
    new HandleSmry(this._smryGui, null, { args: this._smryArgs });
  }
  
  var gui = GuiSearchParcel.instance(this._gui.mailNo, this._gui.customerNo, this._gui.product, this._gui.search, this._gui.cfrom,this._gui.cto,this._gui.psend, this._gui.preceived);
  new HandleSearchParcel(gui, this._item, { callbackFunc: function(condition) { _self._retrieveProduces.call(_self, 1, condition); }, query: '(' + this._query + ')' });
  
  Pagination.makePagedResults(this._gui.pages, this._parameters.page, this._parameters.total, this._parameters.size, function(page, condition) { _self._retrieveProduces.call(_self, page, _self._parameters.condition); }, this, document);
  
  new TableParcels(this._gui.tasks, this._produces, { user: this._operator, date: this._now, callbackFunc: function() { _self._retrieveProduces.call(_self, 1, _self._parameters.condition); }, hidePrice: true, menu: this._menu, mails: true });
};